package by.brest.bspc.service.reporter.extractors;

import by.brest.bspc.domain.Student;
import by.brest.bspc.reporter.extractors.WorkLoadExtractor;
import by.brest.bspc.service.WorkLoadExtractorService;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.File;
import java.util.List;

/**
 * Implements service for student extractors.
 *
 * @date: 10/5/13 1:47 PM
 * @author: frehty
 */
@Service
public class StudentsExtractorService implements WorkLoadExtractorService {

    private WorkLoadExtractor studentExtractor;

    @Resource
    @Required
    public void setStudentExtractor(WorkLoadExtractor studentExtractor) {
        this.studentExtractor = studentExtractor;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Student> extractStudentsWorkload(File directoryWithStudentsFiles, File directoryWithWorkloads, String groupName) {
        return studentExtractor.extractStudentsWorkload(directoryWithStudentsFiles, directoryWithWorkloads, groupName);
    }
}
